<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ui" uri="http://com.am.tag"%>
<%@ include file="../common.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
	<title>平台应用</title>
	<head>
		<link rel="stylesheet" type="text/css" href="${path }/css/bpm.css" />
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<style type="text/css"> 
		
			.indexul{
			 padding:0px;
			 margin:0px;
			 text-align: center;
			}
			
			.indexul img {
			 height:64px;
			 width:64px;
			}
			
			.indexul li {
			 text-align: center;
			 float: left;
			 width: 70px;
			 height:110px;
			 margin: 12px;
			 padding: 3px;
			 list-style-type: none;
			}
		</style>
		
		
		<script type="text/javascript">
		
		//更新病人信息
		function resetPersonInfo(map)
		{
			Form.bindForm("winForm",map);
		}
		
		function prescription()
		{
			var record_id = $('#record_id').val();
			if(!record_id){
				alert("请先选择候诊病人");
				return ;
			}
			openDailog("view1","${path}/jsp/doctor/prescription.jsp?record_id=" + record_id,430,570,"处方笺",false,true,null);
		}
		
		function modifyData()
  		{
  			var personId = $('#personId').val();
  			if(!personId){
				alert("请先选择候诊病人");
				return ;
			}
  			openDailog("view","${path}/jsp/doctor/modifyPerson.jsp?personId="+ personId,680,230,"修改资料",false,true,null,function(dlg){
  				dlg.getIFrame().doSave();
  			});
  		}
		
		function checkRecord()
  		{
			var personId = $('#personId').val();
			if(!personId){
				alert("请先选择候诊病人");
				return ;
			}
  			openDailog("view1","${path}/jsp/doctor/diseaseHistoryQuery.jsp?personId=" + personId,750,400,"病历查询",false,true,null);
  		}
	  		
	  	function diseaseLeaveQuery()
  		{
  			var personId = $('#personId').val();
  			if(!personId){
				alert("请先选择候诊病人");
				return ;
			}
  			openDailog("view","${path}/jsp/doctor/diseaseLeaveQuery.jsp?personId=" + personId,750,400,"病假查询",false,true,null);
  		}
	  		
  		function dressingQuery()
  		{
  			var personId = $('#personId').val();
  			if(!personId){
				alert("请先选择候诊病人");
				return ;
			}
  			openDailog("view","${path}/jsp/doctor/dressingQuery.jsp?personId=" + personId,750,400,"换药查询",false,true,null);
  		}
	  		
	  	function referralQuery()
  		{
	  		var personId = $('#personId').val();
	  		if(!personId){
				alert("请先选择候诊病人");
				return ;
			}
  			openDailog("view","${path}/jsp/doctor/referralQuery.jsp?personId=" + personId,750,400,"转诊查询",false,true,null);
  		}
		
	  	function injectionQuery()
	  	{
	  		var personId = $('#personId').val();
	  		if(!personId){
				alert("请先选择候诊病人");
				return ;
			}
  			openDailog("view","${path}/jsp/doctor/injectionQuery.jsp?personId=" + personId,750,400,"注射查询",false,true,null);
	  	}
	  	
	  	function prescriptionDrugQuery()
	  	{
	  		var personId = $('#personId').val();
	  		if(!personId){
				alert("请先选择候诊病人");
				return ;
			}
  			openDailog("view","${path}/jsp/doctor/prescriptionDrugQuery.jsp?personId=" + personId,750,400,"处方用药查询",false,true,null);
	  	}
	  	
		function dressing()
		{
			var record_id = $('#record_id').val();
			if(!record_id){
				alert("请先选择候诊病人");
				return ;
			}
			openDailog("view","${path}/jsp/doctor/dressing.jsp?record_id="+ record_id,450,520,"换药单",false,true,null,function(dlg){
				dlg.getIFrame().doSave();
			});
		}
  			
  		function diseaseLeave()
		{
			var record_id = $('#record_id').val();
			if(!record_id){
				alert("请先选择候诊病人");
				return ;
			}
			openDailog("view","${path}/jsp/doctor/diseaseLeave.jsp?record_id="+ record_id,480,500,"申请病假",false,true,null,function(dlg){
			
				dlg.getIFrame().doSave();
			});
		}
		
		function referral()
		{
			var record_id = $('#record_id').val();
			var person_id = $("#personId").val();
			if(!record_id){
				alert("请先选择候诊病人");
				return ;
			}
			openDailog("view","${path}/jsp/doctor/referral.jsp?record_id="+ record_id + "&person_id=" + person_id,900,500,"申请转诊",false,true,null);
		}
  			
  		function doctor()
		{
			var record_id = $('#record_id').val();
			var person_id = $("#personId").val();
			if(!record_id){
				alert("请先选择候诊病人");
				return ;
			}
			
			openDailog("view","${path}/jsp/doctor/doctor.jsp?record_id="+record_id + "&person_id=" + person_id,1100,550,"电子处方",false,true,null,function(dlg){
			
				dlg.getIFrame().doSave();
			});
		}
  		
  		function injection()
  		{
  			var record_id = $('#record_id').val();
  			if(!record_id){
				alert("请先选择候诊病人");
				return ;
			}
  			openDailog("view","${path}/jsp/doctor/injection.jsp?record_id=" + record_id,520,510,"输液单",false,true,null,function(dlg){
				dlg.getIFrame().doSave();
			});
  		}
  		
  		function getPersonInfo(personId,record_id)
  		{
  			$("#personId").val(personId);
  			$("#record_id").val(record_id);
			$("#time").val(new Date().toLocaleDateString());
			
  			ajax.remoteCall("com.system.dao.DoctorDao:getPersonInfo",[record_id+"",personId+""],function(reply){
					result = reply.getResult();
					if(result.type == "0"){
						$("#type").val("学生");
					}else if(result.type == "1"){
						$("#type").val("教职工");
					}else if(result.type == "2"){
						$("#type").val("退休");
					}else if(result.type == "3"){
						$("#type").val("离休");
					}else{
						$("#type").val("其他");
					}
					
					Form.bindForm("winForm",result);
					$("#totalAmount").val(result.totalAmount.value);
					$("#times").val(result.times);
			});
  		}
  		
  		function doSubmit(){
  			var record_id = $('#record_id').val();
  			if(!record_id){
				alert("请先选择候诊病人");
				return ;
			}
  			//if(confirm("您确定要提交吗?"))
  			//{
  				ajax.remoteCall("com.system.dao.DoctorDao:submit",[record_id+""],function(reply){
  		 			var result = reply.getResult();
  		 			if(result.type=="success"){
  		 				alert(result.value);
  		 				location.reload();
  		 			}
  		 			
  		 		});
  			//}
  		}
  		
  		function doReturn(){
  			var record_id = $('#record_id').val();
  			if(!record_id){
				alert("请先选择候诊病人");
				return ;
			}
  			
  			//if(confirm("您确定要返回吗?"))
  			//{
  				ajax.remoteCall("com.system.dao.DoctorDao:back",[record_id+""],function(reply){
  		 			var result = reply.getResult();
  		 			if(result.type=="success"){
  		 				alert(result.value);
  		 				location.reload();
  		 			}
  		 			
  		 		});
  			//}
  		}
  		
		</script>
	</head>
	 <body style="overflow-x: hidden;overflow-y:hidden;">
	 	<input id="record_id" type="hidden" name="record_id">
	 	<input id="personId" type="hidden" name="personId">
    	<table cellSpacing="0" cellPadding="0" style="width:100%;height:100%" border="0">
  			<tr>
				<td class="windowTitle" colspan="2" >医生工作站  &gt; 医生诊断</td>
			</tr>
			
			<tr>
				<td width="150px">
					<iframe src="${path}/jsp/doctor/leftMenu.jsp" width="100%" height="99%" frameborder="0"></iframe>
				</td>
				
				<td>
					<form id="winForm">
						
					<table width="15%" style="margin:10px 0 0 82%">
						<tr>
							<td>
								<ui:Permission value="doctor_diagnose_submit">
									<ui:Button type="save" onclick="doSubmit()">提交</ui:Button>&nbsp;&nbsp;
								</ui:Permission>
								<ui:Permission value="doctor_diagnose_back">
									<ui:Button type="edit" onclick="doReturn()">返回</ui:Button> 
								</ui:Permission>
							</td>
						</tr>
					</table>
							
					<table width="142px" height="24px" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td width=20px ></td>
							<td align=center background="${path }/images/doctorTotal/RedTitle.jpg" style="background-repeat:no-repeat;" >病人信息</td>
						</tr>
					</table>
					
							
					<table width="98%" border="0" cellpadding="0" cellspacing="0" style="border:1 solid #D1BD94; background-image:url(${path}/images/YellowBackground.jpg) repeat-x top;margin-left:5px">
						<tr>
							<td style="padding:5px"><span>姓名：</span><input type="text" name="name" id="name" readOnly style="border:0;margin-bottom:-3px;background-color:#FEFDF9;width:120px;"></td>
							<td style="padding:5px"><span style="margin-left:0.6cm">电话：</span><input type="text" id="telephone" name="telephone" readOnly style="border:0;margin-bottom:-3px;background-color:#FEFDF9;width:120px;"></td>
							<td style="padding:5px"><span style="margin-left:0.6cm">班级：</span><input type="text"  name="class" id="class" readOnly style="border:0;margin-bottom:-3px;background-color:#FEFDF9;width:180"></td>
							<td style="padding:5px">单次就诊金额上限：<input type="text" name="max_consume" id="max_consume" readOnly style="border:0;margin-bottom:-3px;background-color:#FEFDF9;width:35;"></td>
						</tr>
						
						<tr>
							<td style="padding:5px"><span >性别：</span><input type="text" id="sex" name="sex" id="name2" readOnly style="border:0;margin-bottom:-3px;background-color:#FEFDF9;width:60px;"></td>
							<td style="padding:5px"><span style="margin-left:0.6cm">地址：</span><input type="text" id="address" name="address" readOnly style="border:0;margin-bottom:-3px;background-color:#FEFDF9;width:120px;"></td>
							<td style="padding:5px">医保卡号：<input type="text" id="card_num" name="card_num" readOnly style="border:0;background-color:#FEFDF9;margin-bottom:-3px;width:140;"></td>
							<td style="padding:5px">今年就诊次数：<input id="times" name="times" type="text" readOnly style="border:0;background-color:#FEFDF9;margin-bottom:-3px;width:35"></td>
							<td rowspan="3" style="padding:5px;">
								<ui:Permission value="doctor_modify">
									<img  onclick="modifyData()" title="修改资料" style="text-decoration:none;width:64px;height:64px;cursor:pointer" src="${path }/images/doctorTotal/text_directory.png"></img><br>&nbsp;<a>修改资料</a>
								</ui:Permission>
							</td>
						</tr>
						
						<tr>
							<td style="padding:5px"><span>类型：</span><input type="text" id="type" readOnly style="border:0;background-color:#FEFDF9;width:60px;margin-bottom:-3px;"></td>
							<td style="padding:5px">就诊时间：<input type="text" id="time" name="time"  readOnly style="border:0;background-color:#FEFDF9;width:141px;margin-bottom:-3px;"></td>
							<td style="padding:5px">既往病史：<input type="text" name="anamnesis" id="anamnesis" readOnly style="border:0;background-color:#FEFDF9;width:140px;margin-bottom:-3px;"></td>
							<td style="padding:5px">今年就诊总额：<input id="totalAmount" name="totalAmount" type="text" readOnly style="border:0;background-color:#FEFDF9;margin-bottom:-3px;color:red;width:60px;"></td>
						</tr>
					</table>
					
					<table width="142px" height="24px" border="0" cellpadding="0" cellspacing="0" style="margin-top:30px">
						<tr>
							<td width=20px ></td>
							<td align=center background="${path}/images/doctorTotal/YellowTitle.jpg" style="background-repeat:no-repeat;" >功能清单</td>
						</tr>
					</table>
						
					<table width="98%" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #D1BD94;background:#FEFDF9; background-image:url(${path}/images/doctorTotal/YellowBackground.jpg) repeat-x top;margin-left:5px">
						<tr>
							<td>	
								<ul class="indexul">
									<ui:Permission value="doctor_diagnose">
										<li style="width:140px"><a href="javascript:void(0)" onClick="doctor()" >
											<img src="${path }/images/doctorTotal/stethoscope.png" align="middle" border=0 >
											<br>诊断
											</a>
										</li>
									</ui:Permission>
									<ui:Permission value="doctor_diseaseLeave">
										<li style="width:140px">
											<a href="javascript:void(0)" onClick="diseaseLeave()" >
												<img src="${path }/images/doctorTotal/sick_leave.png" align="middle" border=0 >
												<br>病假
											</a>
										</li>
									</ui:Permission>
									<ui:Permission value="doctor_dressing">
										<li style="width:140px">
											<a href="javascript:void(0)" onClick="dressing()" >
												<img src="${path }/images/doctorTotal/bandage.png" align="middle" border=0 >
												<br>换药
											</a>
										</li>
									</ui:Permission>
									<ui:Permission value="doctor_referral">
										<li style="width:140px">
											<a href="javascript:void(0)" onClick="referral()" >
												<img src="${path }/images/doctorTotal/ambulance.png" align="middle" border=0 >
												<br>转诊
											</a>
										</li>
									</ui:Permission>
									<ui:Permission value="doctor_infuse">
										<li style="width:140px">
											<a href="javascript:void(0)" onClick="injection()" >
											<img src="${path }/images/doctorTotal/injection.png" align="middle" border=0 >
											<br>注射和输液
											</a>
										</li>
									</ui:Permission>
									<ui:Permission value="doctor_prescription">
										<li style="width:100px">
											<a href="javascript:void(0)" onClick="prescription()" >
											<img src="${path }/images/doctorTotal/text_enriched.png" align="middle" border=0 >
											<br>处方笺
											</a>
										</li>
									</ui:Permission>
								</ul>
							</td>
						</tr>
					</table>
					 	
					<table width="142px" height="24px" border="0" cellpadding="0" cellspacing="0" style="margin-top:30px">
						<tr>
							<td width=20px ></td><td align=center background="${path }/images/doctorTotal/GreenTitle.jpg" style="background-repeat:no-repeat;" >查询信息</td>
						</tr>
					</table>
						
					<table width="98%" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #DCAEAB;background:#FEFBFB url(${path}/images/RedBackground.jpg) repeat-x top;margin-left:5px" >
						<tr>
							<td>
								<ul class="indexul">
									<ui:Permission value="doctor_diagnose_query">
										<li style="width:140px">
											<a href="javascript:void(0)" onClick="checkRecord()" >
												<img src="${path }/images/doctorTotal/reportorium.png" align="middle" border=0 >
												<br>病历查询
											</a>
										</li>
									</ui:Permission>
									<ui:Permission value="doctor_diseaseLeave_query">
										<li style="width:140px">
											<a href="javascript:void(0)" onClick="diseaseLeaveQuery()" >
												<img src="${path }/images/doctorTotal/sick.png" align="middle" border=0 >
												<br>病假查询
											</a>
										</li>
									</ui:Permission>
									<ui:Permission value="doctor_dressing_query">
										<li style="width:140px">
											<a href="javascript:void(0)" onClick="dressingQuery();" >
												<img src="${path }/images/doctorTotal/drug_basket.png" align="middle" border="0" >
												<br>换药查询
											</a>
										</li>
									</ui:Permission>
									<ui:Permission value="doctor_referral_query">
										<li style="width:140px">
											<a href="javascript:void(0)" onClick="referralQuery()" >
												<img src="${path }/images/doctorTotal/beos_query.png" align="middle" border="0" >
												<br>转诊查询
											</a>
										</li>
									</ui:Permission>
									<ui:Permission value="doctor_infuse_query">
										<li style="width:140px">
											<a href="javascript:void(0)" onClick="injectionQuery()" >
												<img src="${path }/images/doctorTotal/edit_find.png" align="middle" border="0" >
												<br>注射查询
											</a>
										</li>
									</ui:Permission>
									<li style="width:100px">
										<a href="javascript:void(0)" onClick="prescriptionDrugQuery()" >
											<img src="${path }/images/medical_pot_pills.png" align="middle" border="0" >
											<br>处方用药查询
										</a>
									</li>
								</ul>
							</td>
						</tr>
					</table>
				</form>
			</td>
		</tr>
   	</table>
   	
  </body>
</html>

